#pragma once 

#include<stdio.h>

#define NUM 1024
#define BUFFER_NONE 1
#define BUFFER_LINE 2
#define BUFFER_ALL 4

typedef struct MY_FILE
{
  int fd;
  int flags;//flush method
  char outputbuffer[NUM];
  int current;
}MY_FILE;


MY_FILE* my_fpen(const char *path, const char *mode);
size_t my_fwrite(const void *ptr, size_t size, size_t nmemb, MY_FILE *stream);
int my_fclose(MY_FILE *fp);
int my_fflush(MY_FILE *fp);

